package com.hrh.selectsystem.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hrh.selectsystem.model.dto.file.StudentExcelImport;
import com.hrh.selectsystem.model.dto.matchResult.MatchRecordAddRequest;
import com.hrh.selectsystem.model.dto.student.StudentQueryRequest;
import com.hrh.selectsystem.model.dto.student.StudentUpdateRequest;
import com.hrh.selectsystem.model.entity.Mentor;
import com.hrh.selectsystem.model.entity.Student;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hrh.selectsystem.model.vo.student.LoginStudentVO;
import com.hrh.selectsystem.model.vo.student.StudentByMentorVO;
import com.hrh.selectsystem.model.vo.student.StudentVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author hetongxue
* @description 针对表【student(学生)】的数据库操作Service
* @createDate 2024-10-23 11:33:32
*/
public interface StudentService extends IService<Student> {

    /**
     * 用户登录
     *
     * @param studentAccount
     * @param studentPassword
     * @param request
     * @return
     */
    LoginStudentVO studentLogin(String studentAccount, String studentPassword, HttpServletRequest request);

    /**
     * 用户注销
     * @param request
     * @return
     */
    boolean studentLogout(HttpServletRequest request);

    /**
     * 获取当前登录用户
     * @param request
     * @return
     */
    Student getLoginStudent(HttpServletRequest request);

    /**
     * 学生信息脱敏
     * @param student
     * @return
     */
    StudentVO getStudentVO(Student student);

    /**
     * 提取更新请求的非空字段
     * @param studentUpdateRequest
     * @param student
     * @return
     */
    Student notNullStudent(StudentUpdateRequest studentUpdateRequest, Student student);

    /**
     * 获取查询条件
     * @param studentQueryRequest
     * @return
     */
    Wrapper<Student> getQueryWrapper(StudentQueryRequest studentQueryRequest);

    /**
     * 从excel批量导入学生
     * @param studentExcelList
     */
    void importStudentsFromExcel(List<StudentExcelImport> studentExcelList);

    /**
     * 获取导师申请学生列表
     * @param mentor
     * @return
     */
    List<StudentByMentorVO> listApplyStudents(Mentor mentor);

    /**
     * 获取当前进行中的轮次
     * @return
     */
    Integer getStartedRound();

    /**
     * 获取导师已选学生列表
     * @param mentor
     * @return
     */
    List<StudentByMentorVO> listSuccessStudents(Mentor mentor);

    /**
     * 获取未分配导师学生
     * @param studentQueryRequest
     * @return
     */
   Page<Student> getStudentNoMentor(StudentQueryRequest studentQueryRequest, Long current, Long size);
}
